package com.service;

import com.Dao.ReplyDao;
import com.bean.Reply;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

public class ReplyService {
    ReplyDao dao=new ReplyDao();
    public  void addReply(Reply reply){
        try {
            dao.addReply(reply);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
            System.out.println("添加回复失败！！!");
        }
    }

    public void deleteReply(int id){
        try {
            dao.deleteReply(id);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
            System.out.println("删除回复失败！!!");
        }
    }

    public List<Reply> getAllReply(int remarkId) throws SQLException {
        return dao.getAllReply(remarkId);
    }

    public Date findPubTime(int id) throws SQLException {
        return dao.findPubTime(id);
    }

    public List<Reply> queryReply(int remarkId) throws SQLException {
        return dao.queryReply(remarkId);
    }
}
